<?php if (!defined('BASEPATH')) exit('No direct script access allowed');

class Admindash extends CI_Controller {
  public function __construct() {
    parent::__construct();
    $this->load->library('session');
    auth_user();
  }

  public function index() {
    $session = $this->session->all_userdata();
    $data['adminview'] = 'admin/tpls/admindash';
    $data['data' ] = array(
      'lastlogin' => $session['lastlogin']
    );

    $this->load->view('admin/layouts/adminpage', $data);
  }

  public function data() {
    $data['adminview'] = 'admin/tpls/app_view';
    $data['data' ] = array(
      '1' => 1
    );
    $this->load->view('admin/layouts/adminpage', $data);
  }

  public function subscriber() {
    $this->load->view('admin/tpls/subscribers_view');
  }

  public function subscriberedit() {
    $this->load->view('admin/tpls/subscriberedit_view');
  }

	/**
	 * This is the page where I am running all my migrations.
	 */
	public function migrate() {
		$this->load->library('migration');
		$this->migration->version(2);
	}

	public function testmail() {
		$this->load->model('admin/mail_model');
		$to = 'amitavroy@gmail.com';
		$subject = 'Test mail';
		$body = 'This is a test mail';
		//$this->mail_model->send_mail($to, $subject, $body);
	}
}